package com.smxy.mall.dao;

import com.smxy.mall.entity.News;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;


public interface NewsDao extends JpaRepository<News,Object>, JpaSpecificationExecutor<News> {
//    Page<News> newsList(Example example,Pageable pageable); //分类新闻列表
    Page<News> findAll(Pageable pageable); //全部新闻列表
    News findById(Integer id);  //新闻详情
    Page<News> findByCategoryId(Integer categoryId,Pageable pageable);
}
